package com.qt.entity;

import java.util.Objects;

public class Animal {

     private String name = "animal";
    private String name2 = "我洗你爸爸";
    private double age;


     public Animal() {
     }

     public Animal(String name, String name2, double age) {
          this.name = name;
          this.name2 = name2;
          this.age = age;
     }

     /**
      * 获取
      * @return name
      */
     public String getName() {
          return name;
     }

     /**
      * 设置
      * @param name
      */
     public void setName(String name) {
          this.name = name;
     }

     /**
      * 获取
      * @return name2
      */
     public String getName2() {
          return name2;
     }

     /**
      * 设置
      * @param name2
      */
     public void setName2(String name2) {
          this.name2 = name2;
     }

     /**
      * 获取
      * @return age
      */
     public double getAge() {
          return age;
     }

     /**
      * 设置
      * @param age
      */
     public void setAge(double age) {
          this.age = age;
     }

     @Override
     public String toString() {
          return "Animal{name = " + name + ", name2 = " + name2 + ", age = " + age + "}";
     }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Animal animal = (Animal) o;
        return Double.compare(animal.age, age) == 0 && Objects.equals(name, animal.name) && Objects.equals(name2, animal.name2);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, name2, age);
    }
}
